import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'

Vue.use(Vuex)

export default new Vuex.Store({
  state: state,
//   mutations: {
//       hcChange(state, city) {
//         state.city = city
//       }
//   },
//   actions: {
//       hotCityChange(ctx, city) {
//           ctx.commit('hcChange', city)
//       }
//   },
  mutations: mutations,
  actions: {
  },
  modules: {
  },
  //getters相当于state的计算属性
  getters: {
      doubleCity() {
          //不用this?
          return state.city + state.city
      }
  }
})
